package cn.zane.principle.richterSubstitutionPrinciple.design;

import lombok.extern.slf4j.Slf4j;

import java.math.BigDecimal;
import java.util.List;

/**
 * @Author: zane
 * @Date: 2024/12/16
 * @Description:
 */
@Slf4j
public abstract class BankCard {

    private String cardNo;
    private String cardDate;

    public BankCard(String cardNo, String cardDate) {
        this.cardNo = cardNo;
        this.cardDate = cardDate;
    }

    abstract boolean rule(BigDecimal amount);

    // 收入
    public String positive(String orderId, BigDecimal amount) {
        log.info("卡号:{} 收入成功，单号:{} 金额:{}", cardNo, orderId, amount);
        return "0000";
    }

    // 支出
    public String negative(String orderId, BigDecimal amount) {
        log.info("卡号:{} 支出成功，单号:{} 金额:{}", cardNo, orderId, amount);
        return "0000";
    }

    public List<String> tradeFlow() {
        log.info("交易流水查询成功");
        return List.of("10001,100.00","10001,80.00");
    }
}
